package controller

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"go-web-lib/module"
)

type Order struct {

}

func NewOrder() *Order {
	return &Order{}
}

func init()  {
	u :=&Order{}


	module.Register(u,"order").WithGroup("order/v1").
		WithMethod(module.GET).
		WithPath("query:name").
		WithHandlerFunc(u.HelloWorld)

	module.Register(u,"order").WithGroup("order/v1").
		WithMethod(module.PUT).
		WithPath("query:id").
		WithHandlerFunc(u.HelloWorld)

	module.Register(u,"order").WithGroup("order/v1").
		WithMethod(module.GET).
		WithPath("save").
		WithHandlerFunc(u.HelloWorld)

}
func (t *Order)HelloWorld(ctx *gin.Context) {

	fmt.Println("hello world")
}